﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">



</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <style type="text/css">
.btn
{
margin-top:10px;
width:120px;
height:25px;
margin-right:5px;
}
</style>
<button id="bom"class="btn" style=" margin-left:100px;">TOPCORDBOM</button>
<button id="exp"class="btn" >HEAD_TAIL</button>
<button id="wast"class="btn">WASTE</button>
<button id="com" class="btn">CompoundUse</button>
<button id="com_ch" class="btn">TOPCORD CMPCHG</button>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="TableContent" runat="server">
    <hr />
<table>
<tr><td colspan="2" style="font-size:large; line-height:40px;">Report Allocate</td></tr>
<tr><td>DateFrom</td><td><input type="text" id="dFrom"/></td></tr>
<tr><td>DateTo</td><td><input type="text"  id="dTo"/><button  id="search"></button></td></tr>

</table><hr />
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">
    <% if (false)
      { %>
   <script src="../../Scripts/jquery-1.7.2.js" type="text/javascript"></script>
   <% }; %>

   <script type="text/javascript">
       $(function () {
           $("#search").button({
               icons: { primary: 'ui-icon-circle-zoomout' }, text: false
           }).click(function () {
               if ($("#dFrom").val() == "") {
                   alert("ระบุวันที่ DateFrom");
                   $("#dFrom").focus();
                   return;
               }
               var url = '<%=Url.Action("allocate_report") %>' + '?prdF=' + $("#dFrom").val();
               url = url + '&prdT=' + $("#dTo").val();
               window.location = url;
           }); //click

           $('#dFrom').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
           $('#dTo').dateEntry({ useMouseWheel: false, dateFormat: 'dmy/' })
           $("#exp").click(function () {
               $.download('<%=Url.Action("Export") %>', "table=" + 'HEAD')
           });
           $("#wast").click(function () {
               $.download('<%=Url.Action("Export") %>', "table=" + 'waste')
           });
           $("#com").click(function () {
               $.download('<%=Url.Action("Export") %>', "table=" + 'compound')
           });
           $("#bom").click(function () {
               $.download('<%=Url.Action("Export") %>', "table=" + 'bom')
           });
           $("#com_ch").click(function () {
               $.download('<%=Url.Action("Export") %>', "table=" + 'compound_ch')
           });

       });
</script>
</asp:Content>
